<%@include file="/page/tag.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<!--框架必需start-->
<script type="text/javascript" src="${ctp}/QUI/libs/js/jquery.js"></script>
<script type="text/javascript" src="${ctp}/js/qui/language/cn.js"></script>
<script type="text/javascript" src="${ctp}/QUI/libs/js/framework.js"></script>
<link href="${ctp}/QUI/libs/css/import_basic.css" rel="stylesheet"	type="text/css" />
<link href="${ctp}/QUI/libs/skins/lightBlue/style.css" rel="stylesheet" type="text/css" id="theme" themeColor="deepBlue"/>

<!-- 表单验证start -->
<script src="${ctp}/QUI/libs/js/form/validationRule.js" type="text/javascript"></script>
<script src="${ctp}/QUI/libs/js/form/validation.js" type="text/javascript"></script>
<!-- 表单验证end -->

<!-- 树组件start -->
<script type="text/javascript" src="${ctp}/js/qui/ztree.js"></script>
<link type="text/css" rel="stylesheet" href="${ctp}/css/ztree.css"></link>
<!-- 树组件end -->

<!-- 树形下拉框start -->
<script type="text/javascript" src="${ctp}/QUI/libs/js/form/selectTree.js"></script>
<!-- 树形下拉框end -->

<!-- 日期选择框start -->
<script type="text/javascript" src="${ctp}/QUI/libs/js/form/datePicker/WdatePicker.js"></script>
<!-- 日期选择框end -->

<!-- 树形双选器start -->
<%-- <script type="text/javascript" src="${ctp}/QUI/libs/js/form/listerTree.js"></script> --%>
<script type="text/javascript" src="${ctp}/js/qui/listerTree.js"></script>
<!-- 树形双选器end -->


<!--框架必需end-->

<style>
.del_f{
	margin-left: 10px;
}
tr{    height: 16px;}
</style>
</head>
<body>

	<form id="ff" target="frmright" class="" method="post" action="" failAlert="验证未通过">
		<input type="hidden"  name="erpGoodInfoId"  value="<c:out value="${erpGoodInfo.erpGoodInfoId }"/>"/>
		<table class="tableStyle" formMode="line">
			
			<tr>
				<td>商品名称：</td>
				<td colspan="">
					<input type="text"  name="goodName" style="width: 90%;" class="validate[required]"  value="<c:out value="${erpGoodInfo.goodName }"/>"/>
				</td>
				
				<td>商品编码：</td>
				<td colspan="">
					<input type="text"  name="goodCode" style="width: 90%;" class="validate[required]"  value="<c:out value="${erpGoodInfo.goodCode }"/>"/>
				</td>
				
			</tr>
			
			<tr>
				<td>成本价：</td>
				<td colspan="">
					<input type="text" name="goodCostPrice" style="width: 90%;" class="validate[required]" value="<c:out value="${erpGoodInfo.goodCostPrice }" default="0.0"/>"/>
				</td>
				
				<td>销售价：</td>
				<td colspan="">
					<input type="text"  name="goodSellPrice" style="width: 90%;" class="validate[required]"  value="<c:out value="${erpGoodInfo.goodSellPrice }" default="0.0"/>"/>
				</td>
			</tr>
			
			<tr>
				<td>拼音全拼：</td>
				<td colspan="">
						<input type="text"  name="fullPinyin" style="width: 90%;" class="validate[required]"  value="<c:out value="${erpGoodInfo.fullPinyin }"/>"/>
				</td>
			
				<td colspan=""> 拼音缩写：</td>
				<td>
					 <input type="text"  name="shortPinyin" style="width: 50%;" class="validate[required]"  value="<c:out value="${erpGoodInfo.shortPinyin }" />"/>
				</td>
			</tr>
			
			<tr>
				<td>单位：</td>
				<td colspan="">
					<select name="goodUnit" selectedValue="<c:out value="${erpGoodInfo.goodUnit }"/>" class="validate[required]"   prompt="请选择商品单位">
						<c:forEach items="${unitList }" var="it">
							<option value="<c:out value="${it.tableKey }"/>"><c:out value="${it.tableKey }"/></option>
						</c:forEach>
					</select>
				
					<%-- 
						<input type="text"  name="goodUnit" style="width: 90%;" class="validate[required]"  value="<c:out value="${erpGoodInfo.goodUnit }"/>"/>
					 --%>
				</td>
			
				<td colspan=""> 排序：</td>
				<td>
					 <input type="text"  name="sortIndex" style="width: 50%;" class="validate[required]"  value="<c:out value="${erpGoodInfo.sortIndex }" default="1"/>"/>
				</td>
			</tr>
			
			<tr>
				<td colspan="4">
					<input type="button" value="提交" onclick="submitF()" />
				 	<input type="reset" value="取消" onclick="closeWin()" />
				 </td>
			</tr>
		</table>
	</form>
	<script>
		function closeWin() {
			top.Dialog.close();
		}

		function submitF() {
			  if($("#ff").validationEngine({returnIsValid: true})){
			 	$.ajax({
					url : "${ctp}/erpGoodInfo/erpGoodInfo_edit.do",
					type : "post",
					data : $("#ff").serialize(),
					success : function(data) {
						var popBox = new top.Dialog({
							Width:300,
	       					Height:110
						});
						if (data.result) {
							popBox.Title = data.msg;
							popBox.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0">\
										<tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_alert" align="absmiddle"></td>\
											<td align="left" id="Message_' + this.ID + '" style="font-size:' + (popBox.defaultFontSize) + 'px;font-family:' + (popBox.defaultFontFamily) + '">' + data.msg + '</td></tr>\
									</table>';
							popBox.ShowCloseButton = false;
							popBox.ShowCancelButton = false;
							
							popBox.OKEvent = function() {
								popBox.close();
								top.frmright.reflushList();
								top.Dialog.close();
							};
							popBox.show();
							popBox.okButton.parentNode.style.textAlign = "center";
						} else {
							top.Dialog.alert(data.msg, null, null, null, 2);
						};
					}
				});
			 };
		}
		
		
	</script>
</body>
</html>

